import { _decorator, Component, Node } from 'cc';
import { UITools } from './Tools/UITools';
const { ccclass, property } = _decorator;

@ccclass('WorlToScreen')
export class WorlToScreen extends Component {
    @property(Node)
    public thisNode: Node = null;
    @property(Node)
    public targetNode: Node = null;

    protected start(): void {
        let targetNodePos = UITools.worlToScreen(this.targetNode, this.thisNode);
        console.log("自己的坐标：" + this.thisNode.position + "目标在屏幕上的坐标：" + targetNodePos);
    }
}


